{% extends 'myadmin/base.html' %}

{% block title %}
<title>会员添加</title>
{% endblock %}

{% block content %}
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">会员注册</strong> / <small>Personal information</small></div>
      </div>

      <hr/>

      <div class="am-g">

        <div class="am-u-sm-5 am-u-md-5 am-u-md-pull-12">
          <!-- 表单上传 -->
          <form class="am-form am-form-horizontal" action="{% url 'myadmin_user_update' %}" method="post" enctype="multipart/form-data">
            {% csrf_token %}
            <input type="hidden" name="id" value="{{ obj.id }}">
            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">手机号</label>
              <div class="am-u-sm-9">
                <input type="text" name="phonenum" value="{{ obj.phonenum }}" required placeholder="手机号 必填">
                <small>必须填写</small>
              </div>
            </div>

            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">密码</label>
              <div class="am-u-sm-9">
                <input type="text" name="password" value="{{ obj.password }}" placeholder="密码 必填">
                <small>必须填写</small>
              </div>
            </div>

            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">昵称</label>
              <div class="am-u-sm-9">
                <input type="text" name="nikename" value="{{ obj.nikename }}" required placeholder="昵称">
                <small>可选</small>
              </div>
            </div>

            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">性别</label>
              <div class="am-u-sm-9">
                <label class="am-radio-inline">
                  <input type="radio" name="sex" required value="男"> 男
                  </label>
                  <label class="am-radio-inline">
                  <input type="radio" name="sex" required value="女"> 女
                  </label>
                </label>
              </div>
            </div>


            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">居住地址</label>
              <div class="am-u-sm-9">
                <input type="text" name="homeaddress" value="{{ obj.homeaddress }}" placeholder="居住地址">
                <small>可选</small>
              </div>
            </div>

            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">头像</label>
              <div class="am-u-sm-9">
                <input type="file" name="img_url" required >
                <input type="hidden" name="old_img_url" value="{{ obj.img_url }}" >
              </div>
            </div>

            <div class="am-form-group">
              <div class="am-u-sm-9 am-u-sm-push-3">
                <button type="submit" class="am-btn am-btn-primary">确认注册</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>

  </div>
  <!-- content end -->
{% endblock %}